/**
 * Copyright (C), 2019-2022, 宇信融汇
 * FileName: DateFormat
 * Author:   666
 * Date:     2022/1/16 16:52
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 666           修改时间           版本号              描述
 */
package com.newdateapi;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;

/**
 * @Classname DateFormat
 * @Description TODO
 * @Date 2022/1/16 16:52
 * @Created by 666
 */
public class DateFormat {
    public static void main(String[] args) {
        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy年MM月dd日 HH:mm:ss");
        LocalDateTime ldt = LocalDateTime.now();
        System.out.println(dtf.format(ldt));
        LocalDateTime localDateTime1 = LocalDateTime.parse("2022年01月16日 16:54:53", dtf);
        System.out.println(localDateTime1.getDayOfMonth());
        System.out.println(localDateTime1.getMonthValue());
        LocalDate ld = LocalDate.now();
        LocalTime lt = LocalTime.now();
        System.out.println(LocalDateTime.of(ld,lt));


    }
}
